package com.theo.service.impl;

import com.theo.entity.FactInfo;
import com.theo.mapper.FactInfoMapper;
import com.theo.service.FactInfoService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 方涛
 * @since 2021-02-02
 */
@Service
public class FactInfoServiceImpl extends ServiceImpl<FactInfoMapper, FactInfo> implements FactInfoService {

    @Autowired
    private FactInfoMapper factInfoMapper;
    @Override
    public int saveFactInfo(FactInfo factInfo) {
        return factInfoMapper.insert(factInfo);
    }

    @Override
    public int deleteFactInfo(Integer id) {
        return factInfoMapper.deleteById(id);
    }

    @Override
    public int updateFactInfo(FactInfo factInfo) {
        return factInfoMapper.updateById(factInfo);
    }

    @Override
    public List<FactInfo> queryAllFactInfo() {
        return factInfoMapper.selectList(null);
    }

    @Override
    public FactInfo queryFactInfoById(Integer id) {
        return factInfoMapper.selectById(id);
    }
}
